package DoublePointer;

import java.util.Scanner;

public class judgeSquareSum {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int c = in.nextInt();
        judgeSquareSum judgeSquareSum = new judgeSquareSum();
        System.out.println(judgeSquareSum.judgeSquareSum(c));
    }

    public boolean judgeSquareSum(int c) {
        int l = 0;
        int target = c;
        int r = (int) Math.sqrt(target);

        while (l <= r) {
            int sum = l*l + r*r;
            if (sum == target) {
                return true;
            } else if (sum > target) {
                r--;
            } else {
                l++;
            }
        }
        return false;
    }
}
